<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <style>
        #d{
            width: 100px;
            height: 100px;
            background-color: red;
            position: absolute;
        }
    </style>

    <script>

        function f1(e){
            alert("f1...");
            alert(e);
        }


        window.onload=function(){

            document.getElementById("a2").onclick=function(){
                alert("f2...");
                alert(event);
            }

        }

        function f3(){
            console.log(event.clientX,event.clientY);
        }

        function move(){
            var d=document.getElementById("d");
            console.log(event.clientX,event.clientY);
            d.style.left=event.clientX+"px";
            d.style.top=event.clientY+"px";


        }

        function clickDiv(){
            // alert("div");
            location="js01.html";
        }

        function clickA(){
            // alert("a");

            event.cancelBubble=true;

            document.getElementById("d").style.display="none";
        }


    </script>


</head>
<!--<body onmousemove="move();">-->
<body>


    <a href="javascript:;" onclick="f1(event);">test1</a>

    <a href="javascript:;" id="a2">test2</a>


<!--    <div id="d" onclick="f3();"></div>-->


    <div id="d" onclick="clickDiv();">
        <a href="javascript:" onclick="clickA();">关闭</a>
    </div>



    <script>
        // document.getElementById("a2").onclick=function(){
        //     alert("f2...");
        // }
    </script>

</body>
</html>